import { Prop, Schema, SchemaFactory } from '@nestjs/mongoose';
interface StatusList {
  time: Date,
  status: string
}
interface OrderDetails {
  ProductName: string,
  standard: string
  property?: string,
  originalprice: number,
  realprice: number,
  count: number,
  Lunchboxfee: number,
  price: number
}
@Schema()
export class Order {
  //订单来源
  @Prop({ type: String })
  origin: string;
  //门店
  @Prop({ type: String })
  outlet: string;
  //订单号
  @Prop({ type: Number })
  OrderID: number;
  //桌号
  @Prop({ type: Number })
  TableModel: number;
  //成交时间
  @Prop({ type: Date })
  DealTime: Date;
  //品牌
  @Prop({ type: String })
  brand: string;
  //金额
  @Prop({ type: Number })
  price: number;
  //买家
  @Prop({ type: String })
  seller: string;
  //手机号
  @Prop({ type: Number })
  phone: number;
  //状态
  @Prop({ type: String })
  status: string
  //虚拟手机号
  @Prop({ type: Number })
  xuphone: number;
  //收货地址
  @Prop({ type: String })
  ShippingAddress: string;
  //订单备注
  @Prop({ type: String })
  remark: string;
  //城市
  @Prop({ type: String })
  city: string;
  //订单明细
  @Prop({ type: Array })
  OrderDetails: Array<OrderDetails>;
  //配送费
  @Prop({ type: Number })
  delivery: number;
  //会员配送费
  @Prop({ type: Number })
  vip: number;
  //订单活动总额
  @Prop({ type: Number })
  numsum: number;
  //总价
  @Prop({ type: Number })
  sum: number;
  //订单状态
  @Prop({ type: Array })
  OrderStatus: Array<StatusList>;
}


export const OrderSchema = SchemaFactory.createForClass(Order)

